package pzl.com.threadrelated;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
            }
        });
    }

    public void click(View v) {
        Intent intent = new Intent();
        switch (v.getId()) {
            case R.id.btnQuit:
                intent.setClass(this, QuitActivity.class);
                break;
            case R.id.btnNotifyMainThread:
                intent.setClass(this, NotifyMainThreadActivity.class);
                break;
            case R.id.btnNotifyWorkThread:
                intent.setClass(this, NotifyWorkThreadActivity.class);
                break;
        }
        startActivity(intent);
    }

}
